// Problem: P1603 斯诺登的密码
// Contest: Luogu
// URL: https://www.luogu.com.cn/problem/P1603
// Memory Limit: 125 MB
// Time Limit: 1000 ms

#include <iostream>
#include <cstdio>
#include <string>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
map<string,int> num;
vector<int> v;
int main(){
	string s;
	num["zero"]=0;
	num["one"]=1;
	num["a"]=1;
	num["another"]=1;
	num["first"]=1;
	num["both"]=2;
	num["two"]=2;
	num["second"]=2;
	num["three"]=3;
	num["third"]=3;
	num["four"]=4;
	num["five"]=5;
	num["six"]=6;
	num["seven"]=7;
	num["eight"]=8;
	num["nine"]=9;
	num["ten"]=10;
	num["eleven"]=11;
	num["twelve"]=12;
	num["thirteen"]=13;
	num["fourteen"]=14;
	num["fifteen"]=15;
	num["sixteen"]=16;
	num["seventeen"]=17;
	num["eighteen"]=18;
	num["nineteen"]=19;
	num["twenty"]=20;
	                 
	
	while(cin>>s){
		int len=s.size();
		for(int i=0;i<len;i++){
			if(s[i]>='A'&&s[i]<='Z') s[i]+=32;
		}
		int m=num[s];
		v.push_back(m*m%100);
	}
	sort(v.begin(),v.end());
	bool flag=false;
	long long ans=0;
	for(int i=0;i<v.size();i++){
		if(v[i]!=0) flag=true;
		if(flag||i==v.size()-1){
			ans=ans*100+v[i];
		}
	}
	cout<<ans;
	return 0;
}